package com.yanqu.road.entity.rank.xrank;

import com.yanqu.road.entity.FieldTypeAnnotation;

import java.math.BigInteger;

@FieldTypeAnnotation(tableName = "t_u_xrank_channel_part")
public class XChannelRankPart {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "类型", select = true, update = true)
    private int conditionType;
    @FieldTypeAnnotation(desc = "渠道ID", select = true, update = true)
    private int channelId;
    @FieldTypeAnnotation(desc = "玩家ID", select = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "昵称")
    private String nickname = "";
    @FieldTypeAnnotation(desc = "排行值")
    private BigInteger value = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "更新时间")
    private long updateTime;

    public XChannelRankPart() {
    }

    public XChannelRankPart(int activityId, int conditionType, int channelId, long userId, String nickname, BigInteger value, long updateTime) {
        this.activityId = activityId;
        this.conditionType = conditionType;
        this.channelId = channelId;
        this.userId = userId;
        this.nickname = nickname;
        this.value = value;
        this.updateTime = updateTime;
    }

    public void replace(XChannelRankPart rankPart) {
        setActivityId(rankPart.getActivityId());
        setConditionType(rankPart.getConditionType());
        setChannelId(rankPart.getChannelId());
        setUserId(rankPart.getUserId());
        setNickname(rankPart.getNickname());
        setValue(rankPart.getValue());
        setUpdateTime(rankPart.getUpdateTime());
    }

    public XChannelRankPart clone() {
        XChannelRankPart rankPart = new XChannelRankPart();
        rankPart.setActivityId(getActivityId());
        rankPart.setConditionType(getConditionType());
        rankPart.setChannelId(getChannelId());
        rankPart.setUserId(getUserId());
        rankPart.setNickname(getNickname());
        rankPart.setValue(getValue());
        rankPart.setUpdateTime(getUpdateTime());
        return rankPart;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getConditionType() {
        return conditionType;
    }

    public void setConditionType(int conditionType) {
        this.conditionType = conditionType;
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        this.channelId = channelId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public BigInteger getValue() {
        return value;
    }

    public void setValue(BigInteger value) {
        this.value = value;
    }
}
